perl -ne '$T=0;/printf/ && s/printf|[ ",;()]+|%[a-z]/ /g && (@A=split) && ($T=1);if($T){$n=0;print "std::cout << \"$A[0] \" << ";print " $A[++$n] <<" for 1..$#A-1;print q( "\n"),"\n"; }else{print}' file
perl -ne '$T=0;/printf/ && s/printf|[ ",;()]+|%[a-z]/ /g && (@A=split) && ($T=1);if($T){$s=($#A+1)/2;$n=0;print "std::cout << ";print "\"$A[$n] \" << $A[$n+++$s] << " for 1..$s;print q("\n":),"\n";}else{print}' file

perl -ne 'print if /printf/ && unless /sprintf/'

sed -i s#//n##g file
sed -i 's#\\n##g' printTypes.cc
